package com.premierleaguestats.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.VerticalPanel;

/*
 * To be implemented later
 */
public class WinnerStats extends Composite{

	private VerticalPanel vPanel = new VerticalPanel();
	private HorizontalPanel winnerStats = new HorizontalPanel(); 
	static private WinnerStats instance = null; 
	
	public WinnerStats(){
		initPage();
		initWidget(winnerStats);
	}
	
	public static WinnerStats getInstance() {
		if(instance == null){
			instance = new WinnerStats();
		}
		return instance;
	}
	
	private void initPage(){
		Button pointsButton = new Button("Watch Ronaldo free kick");
		
		vPanel.add(pointsButton);
		
		
		winnerStats.add(vPanel);
		winnerStats.setPixelSize(1000, 400);
		

		pointsButton.addClickHandler(new ClickHandler() {
	
		@Override
		public void onClick(ClickEvent event) {
			// TODO Auto-generated method stub
			 Window.open("http://www.youtube.com/watch?v=5WmpgeY7tow","_blank","");
			
		}
		});

		
	}
	
}
